<template>
  <a-config-provider :locale="antdLocale">
    <router-view />
  </a-config-provider>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import zhCN from 'ant-design-vue/es/locale/zh_CN'
import enUS from 'ant-design-vue/es/locale/en_US'
import { usePageTitle } from '@/composables/usePageTitle'

const { locale } = useI18n()

// 动态的Ant Design语言配置
const antdLocale = computed(() => {
  return locale.value === 'zh-CN' ? zhCN : enUS
})

// 初始化页面标题国际化
usePageTitle()
</script>

<style lang="less">
html,
body,
#app {
  height: 100vh;
}
</style>

